import type { App } from 'vue';
import { Button } from './Button';
import {
  // Need
  Button as AntButton,
  Input,
  Layout,
} from 'ant-design-vue';
import { Icon } from './ElIcon';
// import { ElScrollbar, ElLink, ElCollapseItem, ElCollapse, ElDrawer } from 'element-plus';

export const setupGlobCom = (app: App<Element>): void => {
  app.component('Icon', Icon);
};
export const setupElScrollbar = (app: App<Element>): void => {
  // app.component('ElScrollbar', ElScrollbar)
  // app.use(ElScrollbar).use(ElLink).use(ElCollapseItem).use(ElCollapse).use(ElDrawer);
};
// const compList = [AntButton.Group, Icon, ElScrollbar, ElLink, ElCollapseItem, ElCollapse, ElDrawer];
const compList = [AntButton.Group, Icon];

export function registerGlobComp(app: App) {
  compList.forEach((comp) => {
    app.component(comp.name || comp.displayName, comp);
  });

  app.use(Input).use(Button).use(Layout);
}
